package com.tt.aile.search.pojo;

import com.tt.aile.common.pojo.PageResult;
import com.tt.aile.item.pojo.Brand;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author 86176 shkstrat
 * @date 2020/11/26 - 20:20
 */
public class SearchResult extends PageResult<Goods> {

    //我们只需要把分类id和名称响应给前端 所以可以以map的形式
    //key：字段
    //value：名称
    //比如： 76 手机
    //map.put("id",76)
    //map.put("name",手机)
    private List<Map<String,Object>> categories;

    private List<Brand> brands;
    //每个规格参数都对应一个map
    //直接渲染成 filters格式
    //map.put(name:规格参数名称)
    //map.put(options:聚合结果)
    private List<Map<String,Object>> specs;

    public List<Map<String, Object>> getSpecs() {
        return specs;
    }

    public void setSpecs(List<Map<String, Object>> specs) {
        this.specs = specs;
    }



    public SearchResult(){

    }

    public SearchResult(Long total, Integer totalPage, List<Goods> items, List<Map<String, Object>> categories, List<Brand> brands,List<Map<String,Object>> specs) {
        super(total, totalPage, items);
        this.categories = categories;
        this.brands = brands;
        this.specs=specs;
    }

    public SearchResult(Long total, List<Goods> items, List<Map<String, Object>> categories, List<Brand> brands,List<Map<String,Object>> specs) {
        super(total, items);
        this.categories = categories;
        this.brands = brands;
        this.specs=specs;
    }

    public SearchResult(List<Map<String, Object>> categories, List<Brand> brands,List<Map<String,Object>> specs) {
        this.categories = categories;
        this.brands = brands;
        this.specs=specs;
    }

    public List<Map<String, Object>> getCategories() {
        return categories;
    }

    public void setCategories(List<Map<String, Object>> categories) {
        this.categories = categories;
    }

    public List<Brand> getBrands() {
        return brands;
    }

    public void setBrands(List<Brand> brands) {
        this.brands = brands;
    }
}
